package org.wj.arithmetic

import org.apache.spark.rdd.RDD
import org.wj.config.LocalSparkContext

// 对挎两个RDD进行并集操作，并返回新的RDD
object Union extends App with LocalSparkContext{

  private val rdd1: RDD[Int] = sc.parallelize(1 to 10)

  private val rdd2: RDD[Int] = sc.parallelize(11 to 20)

  rdd1.union(rdd2).foreach(println(_))

}
